
import React, { memo, useEffect } from "react";

import qs from 'query-string';
import cs from 'classnames';


import { getSongListDetailAction } from './store/actionCreator';
import DetailLeft from './child/detailLeft';
import DetailRight from './child/detailRight';


import sty from './sty.module.css'
import { useDispatch } from "react-redux";
const SongListDetail = (props) => {
  console.log(props.location);
  const { songlistId } = qs.parse(props.location.search);
  console.log("songlistId", songlistId);
  const dispatch = useDispatch();

  useEffect(() => {
    if (songlistId) {
      dispatch(getSongListDetailAction(songlistId))
    }

  }, [dispatch, songlistId])

  return <div className={cs(sty.content, 'wrap2')}>
    <DetailLeft />
    <DetailRight /> </div>
}
export default memo(SongListDetail)